package com.tgy.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/***
 * @ClassName: RequestPassword
 * @Description: 测试登录
 * @Auther: 送一一块二向箔
 * @Date: 21:49 2021/12/4
 * @version : V1.0
 */
public class RequestPassword extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("进入请求");
        //处理请求
        String username = req.getParameter("username");
        String password = req.getParameter("password");

        System.out.println("username："+username+"   password："+password);
        //重定向一定要注意：“路径问题”，否则404
        resp.sendRedirect("/Servlet_02_war/ee.html");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
